<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/vue@next"></script>
    <style>
        .fade-enter-active,
        .fade-leave-active {
            transition: opacity 0.5s ease;
        }

        .fade-enter-from,
        .fade-leave-to {
            opacity: 0;
        }
    </style>
</head>
<body>
    <div id="app">
        <button @click="show = !show">
            Toggle
        </button>

        <transition name="fade">
            <p v-if="show">hello</p>
        </transition>

        <transition name="fade">
            <p v-show="show">hello</p>
        </transition>

    </div>

    <script>
        const AppComp={
            data() {
                return {
                    show: true
                }
            },
        }

        const app = Vue.createApp(AppComp)
        const vm = app.mount("#app")
    </script>
</body>
</html>